import request from '@/utils/request'

// 查询设备维修列表
export function listRepairTask(query) {
    return request({
        url: '/equipment/repairTask/list',
        method: 'get',
        params: query
    })
}

// 查询设备维修详细
export function getRepairTask(repairTaskId) {
    return request({
        url: '/equipment/repairTask/' + repairTaskId,
        method: 'get'
    })
}

// 新增设备维修
export function addRepairTask(data) {
    return request({
        url: '/equipment/repairTask',
        method: 'post',
        data: data
    })
}
// 完成任务

export function repairTaskFinish(data) {
    return request({
        url: '/equipment/repairTask/finish/'+data,
        method: 'PUT'
    })
}
// 修改设备维修
export function updateRepairTask(data) {
    return request({
        url: '/equipment/repairTask',
        method: 'put',
        data: data
    })
}

// 删除设备维修
export function delRepairTask(repairTaskId) {
    return request({
        url: '/equipment/repairTask/' + repairTaskId,
        method: 'delete'
    })
}

//
export function getRepairManOptions(query) {
    return request({
      url: '/system/user/list',
      method: 'get',
      params: query
    })
  }

  // 删除下方问题描述
export function delRepairTaskDetails(repairTaskId) {
    return request({
        url: '/equipment/repairTaskDetail/' + repairTaskId,
        method: 'delete'
    })
}
 // 获取附件
 export function getRepairTaskFile(repairTaskId) {
    return request({
        url: '/equipment/repairAttach/'+repairTaskId,
        method: 'get'
    })
}
  // 删除附件
  export function delRepairTaskFile(repairAttachId) {
    return request({
        url: '/equipment/repairAttach/' + repairAttachId,
        method: 'delete'
    })
}
 // 上传附件
 export function setRepairTaskFile(data) {
    return request({
        url: '/equipment/repairAttach',
        method: 'post',
        data:data
    })
}